package com.lezhu.plcsdklibrary;

import android.view.View;

/**
 * 描述：防止抖动
 * 作者: 钮家齐
 * 时间: 2020/6/18 13:35
 */
public class NoDoubleClickUtils {
    private final static int SPACE_TIME = 400;
    private static long lastClickTime = 0;

    public synchronized static boolean isCanClick() {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastClickTime > SPACE_TIME) {
            lastClickTime = currentTime;
            return true;
        } else {
            return false;
        }
    }
}
